package com.itdr.common;

import lombok.Data;

/**
 * ClassName: Const
 * 日期: 2020/10/21 15:23
 *
 * @author Air张
 * @since JDK 1.8
 */
public class Const {
    public final static Integer SUCCESS=200;
    public final static Integer FAIL=100;
    public final static String SUCCESS_MSG="操作成功";
    public final static String FAIL_MSG="操作失败";
    public final static String TMBNAME = "tmb";
    public final static String GMMNAME = "gmm";
    public final static String LOSE_TOKEN = "令牌失效";
    public final static String NO_MAPPING_TOKEN = "令牌不匹配";


    public enum UserEnum{
        OUT_LOGIN(SUCCESS,"退出成功"),
        EMPTY_USERNAME(101,"用户名不存在"),
        REPEAT_USERNAME(102,"用户名已存在"),
        FAIL_INSERT_USERNAME(103,"用户注册失败"),
        ERROR_USERNAMEORPASSWORD(104,"用户名或密码错误"),
        NO_LOGIN(105,"用户未登录"),
        USED_EMAILORPHONE(106,"邮箱或手机号已存在"),
        FAIL_MSG(107,"信息修改失败"),
        DIFFERENT_USER(108,"身份不匹配"),
        FAIL_UPDATE_PASSWORD(109,"密码修改失败"),
        NO_MB(110,"用户没有密保"),
        FAIL_VERIFY_MB(111,"密保验证失败");
        private int code;
        private String desc;

        private UserEnum(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }


    public enum ProductEnum{
        NO_PRODUCT(201,"商品不存在"),
        OUT_PRODUCT(202,"商品已下架"),
        FAIL_UPDATE(203,"商品更新失败");
        private int code;
        private String desc;

        private ProductEnum(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    public enum CartEnum{
        EMPTY_CART(301,"购物车为空"),
        UPDATE_CART(302,"购物车更新失败"),
        DELETE_CART(303,"购物车移除商品失败"),
        NO_UPDATE_CART(304,"购物车未更新");
        private int code;
        private String desc;

        private CartEnum(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    public enum AddressEnum{
        FAIL_ADD_ADDRESS(4001,"地址添加失败"),
        FAIL_DELETE_ADDRESS(4002,"地址删除失败"),
        NO_ADDRESS(4003,"地址不存在"),
        FAIL_UPDATE_ADDRESS(4004,"地址更新失败");
        private int code;
        private String desc;

        private AddressEnum(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    public enum OrderEnum{
        FAIL_ADD_ORDER(5001,"订单创建失败"),
        FAIL_ADD_ORDERITEM(5002,"订单详情创建失败"),
        NO_ANY_PRODUCT(5003,"没有选中任何商品");
        private int code;
        private String desc;

        private OrderEnum(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

    public enum PayEnum{
        FAIL_PAY_ORDER(6001,"订单支付失败");
        private int code;
        private String desc;

        private PayEnum(int code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }

}
